home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
xecho11.zip
/
XECHO.DOC
< prev
Wrap
Text File
|
1988-04-19
|
3KB
|
58 lines
XECHO.ASM version 1.1 - by John Wright, 19-March-1988
Utility for generating character strings which include control and special
characters. Strings are specified on the command line using "Lotus 1-2-3"
like syntax with "\nnn" being translated as the ASCII code for decimal 'nnn'.
Strings are sent to the standard output and may be redirected to a file or a
device. Note that unlike the ECHO command in DOS, XECHO does not append a
CR,LF pair to the output string.
Usage:
XECHO [xxxxx....] [> file or device spec]
where "x" can be either:
- any character which can be entered on a DOS command line (ie. blanks
and any keyboard characters or ALT-key sequences not filtered by DOS
such as CR (Enter), LF, BS, DEL, ^C, ^P, ">", "<", "|", etc.); all
characters are sent to standard output as is.
- a sequence of characters beginning with "\":
- "\" followed by 1 to 3 digits is translated as the ASCII code
represented by interpreting the digits as a decimal value modulo
256; the sequence is terminated by a non-digit, the end of the
command line or a fourth digit.
- "\" followed by a non-digit character is translated as that char.
Notes:
- TAB characters in the command line string are not expanded.
- leading blanks and TABs (between "xecho" and the first visible char.
following on the command line are skipped; to send strings beginning
with a blanks or tabs use \20 or \9 for at least for the first one.
- trailing blanks and TABs (between the last visible character of the
command and the CR, ">", "<", or "|") are preserved and sent as is.
- "\1", "\01" and "\001" are equivalent (assuming for the first two
cases that the following character is not a digit) to ^A;
- "\0001" would be translated as ASCII NUL followed by "1".
- to send the back-slash character, "\", use "\\" in the command line.
- "\" at the end of the command line is ignored.
- the command "xecho >null" creates an empty file "null".
XECHO is particularly useful for sending control strings to on-line devices
such as printers or modems. For instance "xecho \15>prn" selects condensed
printing on an Epson compatible printer, "xecho \027@>prn" sends a printer
reset, and "xecho \12>prn" sends a form-feed.
Revisions:
1.0 - 2-March-88, J.W. - original
1.1 - 19-March-88, J.W. - limited no. digits after '\' to 3 for
compatibility with Lotus-style strings + improved code
And lest we forget,
"Lotus" *and* "1-2-3" are trademarks of Lotus Development Corp.
"Epson" is a trademark of Seiko Epson Corp.
XECHO is declared in the public domain by its author.
John Wright
Halifax, Nova Scotia, Canada
18-April-88